package com.example.admin.listen;

import com.example.admin.service.WmNewsService;
import com.usian.common.kafka.KafkaTopic;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class AdminKafkaListen {
    @Autowired
    private  WmNewsService wmNewsService;
    @KafkaListener(topics = KafkaTopic.TOPIC)
    public void getMessage(String id){
        System.out.println(id);
        ResponseResult responseResult = wmNewsService.wmNewsChecked(Integer.valueOf(id));
        System.out.println(responseResult);
    }
}
